package com.hq.learnmybatisplus.dao;

import com.baomidou.mybatisplus.annotation.SqlParser;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.hq.learnmybatisplus.entity.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author hq
 */
public interface UserDao extends MyBaseMapper<User> {

    /**
     * @param wrapper
     * SqlParser 3.1.1之前的版本需要在配置文件中 配置 mybatis-plus:global-config:sql-parser-cache: true
     * @return
     */
    @SqlParser(filter = true)
    @Select("select * from user ${ew.customSqlSegment}")
    List<User> mySelectList(@Param(Constants.WRAPPER)Wrapper<User> wrapper);





}
